1. Field of the Invention
The present invention is directed to computer systems. More particularly, it is directed to dynamic tracing mechanisms for computer system applications.
2. Description of the Related Art
The complexity and cost of developing, testing and deploying enterprise-level computer systems applications has been increasing rapidly. In order to reduce overall cost and complexity, many modern enterprise-level computer systems applications are written in platform-independent languages such as the Java™ language supported by Sun Microsystems, and are deployed for execution at virtual machine environments, such as Java Virtual Machines (JVMs) implemented within a variety of J2EE™ (Java 2 Enterprise Edition) compliant application servers from different vendors. By choosing platform-independent programming languages, for example, application vendors may reduce development and porting costs and reduce their reliance on specific hardware vendors and operating systems vendors. In addition, by take advantage of built-in application server features such as transaction support, messaging services, etc., application vendors may also be able to reduce the amount of new code that has to be developed for each new application.
While the use of virtual machines and platform-independent languages provides several advantages for enterprise applications, serviceability and observability mechanisms for such applications have not yet reached a desired level of maturity and sophistication. The terms serviceability and observability may refer to a variety of maintenance-related capabilities, including, for example, the ability to obtain runtime information from a running application, such as performance characteristics, the values of key attributes, and troubleshooting and diagnosis information useful in to resolving perceived problems. While numerous tools and techniques have been developed over the years to analyze different aspects of the behavior of computer systems applications, existing tools and techniques typically fail to provide a comprehensive package of services sufficient to diagnose and resolve a variety of application problems at run time in virtual machine environments, and several of the existing techniques may result in undesirable side effects and/or unacceptable overhead.
Many performance tools and analysis techniques are platform specific, for example, and may not be useful for analyzing application state (e.g., by obtaining values of programming constructs such as variables defined in a platform-independent programming language like Java™) within virtual machines. Some performance tools support monitoring of applications deployed within virtual machine processes, but may require that the virtual machine processes be restarted (often with a changed execution environment such as a modified class path) in order to enable monitoring. While such tools may be useful in development environments, they may be insufficient for diagnosing problems in production environments, where requiring mission-critical applications to be restarted for problem diagnosis may not be feasible. In addition, many performance and/or debug tools may impose a high performance overhead: that is, monitored applications may run substantially slower than unmonitored applications, even when portions of the application that may be unrelated to the cause of a perceived performance problem are being executed. Furthermore, many performance tools may allow only a relatively small set of predefined types of monitoring actions to be performed (e.g., only monitoring of memory usage and/or CPU usage may be supported). In contrast to the limited monitoring support provided by some performance tools, other techniques such as “aspect-oriented programming (AOP)” may allow unrestricted and potentially unsafe modification of application code (e.g., by inserting arbitrary code within an application, including code which may modify application state or may loop forever). Such unrestricted modification of applications may result in unpredictable or undesired behavior such as data corruption, application hangs or crashes, and the like.